﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_MailGetAttachFilesInfoByMailID]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_MailGetAttachFilesInfoByMailID];
GO
-------------------------------------------------------------------------------
-- sproc_MailGetAttachFilesInfoByMailID
----MailIDStr 格式示例: MailID=12 or MailID=34 or MailID=56
-------------------------------------------------------------------------------
CREATE PROCEDURE [dbo].[sproc_MailGetAttachFilesInfoByMailID]
(
    @FileIDStr           NVARCHAR(4000) 
)
AS

    DECLARE @Sql NVARCHAR(4000)
    SELECT @Sql = "SELECT FileName,FileSize,FileVisualPath,FileID FROM TabMailAttachFiles  WHERE "+@FileIDStr
    EXEC(@Sql)